//识别浏览器
let ua = navigator.userAgent
let isChrome = ua.indexOf('Chrome') > -1
//拆解url各个部分
console.log(location.protocol); //http: 或 https:
console.log(location.host); //主机名和端口号
console.log(location.hostname); //主机名
console.log(location.port); //端口号
console.log(location.pathname); //路径
console.log(location.search); //查询字符串
console.log(location.hash); //片段字符串
